package cn.com.controler.VipType;

import cn.com.entity.VipType;

import java.util.List;

public class VipTypeDAO {

    //查询所有类型
    public List selectVipType(){
        String str = "select *from viptype";
        Object [] arr = new Object[]{};
        return VipTypeDAOTemplete.selectdata(str,arr);
    }
    //添加类型
    public int addViptype(VipType vipType){
        String str = "insert into viptype values(null,?,?,?,?)";
        Object[] arr = new Object[]{vipType.getVipTypeName(),vipType.getVipTypeTime(),vipType.getVipTypePrice(),vipType.getVipTypeComment()};
        return VipTypeDAOTemplete.insertdata(str,arr);
    }
    //根据id删除
    public int deleteVipTypeByid(int id){
        String str = "delete from viptype where Id = ?";
        Object[] arr = new Object[]{id};
        return VipTypeDAOTemplete.insertdata(str,arr);
    }
}
